<?php
class Solicitudes_Form_Publicacionproyecto extends Form_Cna {

    public function __construct($options = null) {
        parent::__construct($options);
    }

    public function init() {
        $domConfig = Zend_Registry::get('domConfig'); //esto se crea en el bootstrap
        $this->setName('publicaciondocente');
        $this->setMethod("post");
        $this->setAttrib('enctype', 'multipart/form-data');
        
        $array_elements[] = new Zend_Form_Element_Hidden("codseccionlista");
        $array_elements[] = new Zend_Form_Element_Hidden("codproyecto");
        $array_elements[] = new Zend_Form_Element_Hidden("codpublicacion");

        $element = new Zend_Form_Element_Textarea("nombrepublicacion");
	    $element->setLabel("Publicación (Referencia bibliográfica completa) : ");
	    $element->setRequired(true);
	    $element->addFilter('StripTags');
	    $element->addFilter('StringTrim');
	    $element->setAttrib("rows",2);
	    $element->setAttribs(array('size'=>'90%'));
	    $array_elements[] = $element;
		
		$element = new Zend_Form_Element_Select('tipopublicacion');
		$element->setLabel('Tipo de publicacion :');
		$element->setRegisterInArrayValidator(false);
		$element->setMultiOptions($domConfig->TIPO_PRODUCCION->toArray());
        $element->setRequired(true);
        $array_elements[]=$element;
                      
        $submit = new Zend_Form_Element_Submit('btnSubmit');
        $submit->setValue('Guardar');
        $submit->setLabel("Guardar");
        $submit->setAttrib("class", "iceCmdBtn");
        $array_elements[] = $submit;
        
        $this->addElements($array_elements);
        $this->loadViewScriptDecorators();
//        $this->loadTableDecorators();
    
    }
    
    public function loadViewScriptDecorators() {
        $this->setDecorators(array(array('viewScript',array('viewScript'=>'viewscripts/publicacionproyecto_form.phtml'))));
    }
}

